﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TowerDefence.Entities.States;

namespace TowerDefence.Entities.Actions
{
    public class Move : Action
    {
        public Move(Entity _userEntity, params Entity[] _targetEntities) : base(_userEntity, _targetEntities) { }

        public override void DoAction(TimeSpan _time)
        {
            var entityMoveVector = userEntity.Form.States.GetState<MovementVector>();
            if (entityMoveVector == null) return;
            userEntity.Form.Position += entityMoveVector.Vector * (float)_time.TotalSeconds;
        }
    }
}
